package com.smm.util;

import java.util.*;
import java.io.*;

public class PropertiesReader{

	private Properties p=null;


	public PropertiesReader(String fileName){

		try{

			InputStream in = PropertiesReader.class.getResourceAsStream(fileName);
			this.p = new Properties();
			this.p.load(in);

		}catch(Exception e){

			System.out.println("读取property文件异常："+e.toString());
		}

	}


	public String getValue(String key){

		if(this.p==null) return "";

		String value=this.p.getProperty(key);

		if(value!=null){

			return value.trim();
		}

		return "";
	}



}